#pragma once




#include "resource.h"
#include "../src/acllib.h"
#define _USE_MATH_DEFINES





#include <stdio.h>
#include <time.h>

#include "plane.hpp"
#include "fort.hpp"

typedef struct
{
	int id;
	int interval;
}gf_timer;

typedef struct
{
	coordination coo;
}parachute;

#define JUMP_OUT do{\
	endPaint();\
	return;\
	}while(0)
#define KILL do{\
	endPaint();\
	exit(0);\
}while(0)

namespace VIEW {
	void updateView(void);
};


namespace Listener {
	void mouseEvent(int x, int y, int button, int event);
	void timerEvent(int id);
	void keyboardListener(int key, int event);
}
namespace GF_MATH {
	inline double to_radian(float deg);
	void calculate_coordinations();
}

enum DIRECTIONS
{
	LEFT = 37,
	UP,
	RIGHT,
	DOWN
};
class Bomb
{
	coordination coo;
	int angle;
	void forward();
	Bomb();
	friend class Bombs;
	void paint();
	friend void VIEW::updateView();
public:
	static const int move_d = 5;
	static const int GUN_SIZE = 10;
	coordination get_coo();
};
class Bombs
{
	std::vector<Bomb> bombs;
	friend void VIEW::updateView();

public:
	int angle;
	void add();
	explicit Bombs();
	void forward();
};

namespace GAME {
	const coordination base = { WIDTH / 2,HEIGHT };
	const int intervals[] = { 100,1000 };
	Fort fortInstance;
	Bombs bombsInstance;
	//extern volatile int angle;
	//Plane plane;
	constexpr auto GUN_LENGTH = 0x40;
	constexpr auto D_ANGLE = 3;
};



